/**
 * Copyright (c) 2024 Huawei Technologies Co., Ltd
 * [graph-engine] is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
*/


#ifndef GE_PARSER_TESTS_UT_PARSER_H_
#define GE_PARSER_TESTS_UT_PARSER_H_

#include "framework/omg/parser/parser_inner_ctx.h"

namespace ge {
struct MemBuffer {
  void *data;
  uint32_t size;
};

class ParerSTestsUtils {
 public:
  static void ClearParserInnerCtx();
  static MemBuffer* MemBufferFromFile(const char *path);
  static bool ReadProtoFromText(const char *file, google::protobuf::Message *message);
  static void WriteProtoToBinaryFile(const google::protobuf::Message &proto, const char *filename);
  static void WriteProtoToTextFile(const google::protobuf::Message &proto, const char *filename);
};
}  // namespace ge

#endif  // GE_PARSER_TESTS_UT_PARSER_H_
